home *** CD-ROM | disk | FTP | other *** search
- #include <genstub.c>
-
- LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- static TIME_ZONE_INFORMATION tziInit;
-
- switch (uMsg)
- {
- case WM_CREATE:
- GetTimeZoneInformation( &tziInit ); // save time zone data
- return (DefWindowProc(hWnd, uMsg, wParam, lParam));
- case WM_COMMAND:
- switch ( LOWORD( wParam ) )
- {
- case IDM_TEST:
- {
- TIME_ZONE_INFORMATION tziLocal;
- DWORD dwTimeZoneMode;
- TCHAR szBuffer[128];
-
- dwTimeZoneMode = GetTimeZoneInformation( &tziLocal );
-
- if ( dwTimeZoneMode == TIME_ZONE_ID_STANDARD )
- wsprintf( szBuffer,
- "Time Zone Name: %sST, Bias: %d",
- tziLocal.StandardName,
- tziLocal.Bias + tziLocal.StandardBias );
- else
- wsprintf( szBuffer,
- "Time Zone Name: %sDT, Bias: %d",
- tziLocal.DaylightName,
- tziLocal.Bias + tziLocal.DaylightBias );
-
- MessageBox( hWnd, szBuffer, "Time Zone Data", MB_OK );
-
- // Change time zone data. Add 60 minutes to Bias.
- tziLocal.Bias += 60;
- SetTimeZoneInformation( &tziLocal );
-
- }
- break;
- case IDM_EXIT:
- DestroyWindow( hWnd );
- break;
- }
- break;
- case WM_DESTROY:
- SetTimeZoneInformation( &tziInit ); // Restore time zone data
- PostQuitMessage( 0 );
- break;
- default:
- return (DefWindowProc(hWnd, uMsg, wParam, lParam));
- }
- return (NULL);
- }
-